package com.ruoyi.SSL.domain;

import cn.hutool.core.date.DateTime;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import java.util.Date;

/**
 * 证书申请对象 ssl_apply
 *
 * @author ruoyi
 * @date 2024-09-07
 */
public class SslApply extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 证书Id */
    private Long id;

    private String applyCode; //申请编号
    private String serRecordCode;  //服务端记录编号
    private Long mainId;

    private String isUniversal;

    //云产品证书Id
    private String cloundCertId;

    /** 颁发机构 */
    @Excel(name = "颁发机构")
    private String issuingAuthority;

    /** 证书域名 */
    @Excel(name = "证书域名")
    private String certificateDomain;

    /** 私钥类型（RSA私钥、ECC私钥、手填私钥） */
    @Excel(name = "私钥类型", readConverterExp = "RSA私钥、ECC私钥、手填私钥")
    private String privateKeyType;

    /** 证书私钥 */
    @Excel(name = "证书私钥")
    private String certificatePrivateKey;

    private String certificatePublicKey;

    /** ACME账户 */
    @Excel(name = "ACME账户")
    private String acmeId;

    /** 获取挑战的地址（验证域名所有权） */
    private String authorizations;

    /** 验证是否已经验证了域名所有权接口api地址 */
    private String finalize;

    /** 证书下载地址 */
    private String fileDownload;

    private String sslFilePath;

    private String accountEmail;

    private String authType;

    private Date sslCreateTime;
    private Date expiredTime;

    private Integer daysDifference; //还有多少天到期

    private String whereSql;

    public String getCloundCertId() {
        return cloundCertId;
    }

    public void setCloundCertId(String cloundCertId) {
        this.cloundCertId = cloundCertId;
    }

    public String getWhereSql() {
        return whereSql;
    }

    public void setWhereSql(String whereSql) {
        this.whereSql = whereSql;
    }

    private String sslKeyContent;
    private String sslPemContent;

    public String getSslKeyContent() {
        return sslKeyContent;
    }

    public void setSslKeyContent(String sslKeyContent) {
        this.sslKeyContent = sslKeyContent;
    }

    public String getSslPemContent() {
        return sslPemContent;
    }

    public void setSslPemContent(String sslPemContent) {
        this.sslPemContent = sslPemContent;
    }

    public Date getSslCreateTime() {
        return sslCreateTime;
    }

    public void setSslCreateTime(Date sslCreateTime) {
        this.sslCreateTime = sslCreateTime;
    }

    public String getApplyCode() {
        return applyCode;
    }

    public void setApplyCode(String applyCode) {
        this.applyCode = applyCode;
    }

    public String getSerRecordCode() {
        return serRecordCode;
    }

    public void setSerRecordCode(String serRecordCode) {
        this.serRecordCode = serRecordCode;
    }

    public Integer getDaysDifference() {
        return daysDifference;
    }

    public void setDaysDifference(Integer daysDifference) {
        this.daysDifference = daysDifference;
    }

    public Date getExpiredTime() {
        return expiredTime;
    }

    public void setExpiredTime(Date expiredTime) {
        this.expiredTime = expiredTime;
    }

    public String getSslFilePath() {
        return sslFilePath;
    }

    public void setSslFilePath(String sslFilePath) {
        this.sslFilePath = sslFilePath;
    }

    public String getAuthType() {
        return authType;
    }

    public String getCertificatePublicKey() {
        return certificatePublicKey;
    }

    public void setCertificatePublicKey(String certificatePublicKey) {
        this.certificatePublicKey = certificatePublicKey;
    }

    public void setAuthType(String authType) {
        this.authType = authType;
    }

    /** 状态（待验证域名所有权，颁发中、已颁发） */
    @Excel(name = "状态", readConverterExp = "待=验证域名所有权，颁发中、已颁发")
    private String status;

    public Long getMainId() {
        return mainId;
    }

    public void setMainId(Long mainId) {
        this.mainId = mainId;
    }

    public String getAccountEmail() {
        return accountEmail;
    }

    public void setAccountEmail(String accountEmail) {
        this.accountEmail = accountEmail;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }

    public void setIssuingAuthority(String issuingAuthority)
    {
        this.issuingAuthority = issuingAuthority;
    }

    public String getIssuingAuthority()
    {
        return issuingAuthority;
    }

    public void setCertificateDomain(String certificateDomain)
    {
        this.certificateDomain = certificateDomain;
    }

    public String getCertificateDomain()
    {
        return certificateDomain;
    }

    public void setPrivateKeyType(String privateKeyType)
    {
        this.privateKeyType = privateKeyType;
    }

    public String getPrivateKeyType()
    {
        return privateKeyType;
    }

    public void setCertificatePrivateKey(String certificatePrivateKey)
    {
        this.certificatePrivateKey = certificatePrivateKey;
    }

    public String getCertificatePrivateKey()
    {
        return certificatePrivateKey;
    }

    public void setAcmeId(String acmeId)
    {
        this.acmeId = acmeId;
    }

    public String getAcmeId()
    {
        return acmeId;
    }

    public void setAuthorizations(String authorizations)
    {
        this.authorizations = authorizations;
    }

    public String getAuthorizations()
    {
        return authorizations;
    }

    public void setFinalize(String finalize)
    {
        this.finalize = finalize;
    }

    public String getFinalize()
    {
        return finalize;
    }

    public void setFileDownload(String fileDownload)
    {
        this.fileDownload = fileDownload;
    }

    public String getFileDownload()
    {
        return fileDownload;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }

    public String getStatus()
    {
        return status;
    }

    public String getIsUniversal() {
        return isUniversal;
    }

    public void setIsUniversal(String isUniversal) {
        this.isUniversal = isUniversal;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId()).append("accountEmail", getAccountEmail())
            .append("issuingAuthority", getIssuingAuthority()).append("authType", getAuthType())
            .append("certificateDomain", getCertificateDomain()).append("certificatePublicKey", getCertificatePublicKey())
            .append("privateKeyType", getPrivateKeyType()).append("sslFilePath", getSslFilePath())
            .append("certificatePrivateKey", getCertificatePrivateKey()).append("daysDifference", getDaysDifference())
            .append("acmeId", getAcmeId()).append("expired_time", getExpiredTime())
            .append("authorizations", getAuthorizations()).append("isUniversal", getIsUniversal())
            .append("finalize", getFinalize()).append("mainId", getMainId())
            .append("fileDownload", getFileDownload())
            .append("status", getStatus())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .toString();
    }
}
